Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress: Keep dashicons, icons, and Akismet CSS in the bundle #810

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Nov 27, 2023

playground.wordpress.net ships an optimized WordPress build where most
static assets are removed to keep the initial download snappy. However,
some backend code actually depends on those assets being present as seen
in #729 and #770. This PR allowlists additional files:

  • wp-includes/images/media
  • wp-includes/fonts/dashicons.svg
  • wp-content/plugins/akismet/_inc

Closes #729
Closes #770

Testing instructions

To test, run Playground locally, go to this URL, and confirm it displays
the list of files as shown below.

http://localhost:5400/website-server/#%7B%22landingPage%22:%22/test.php%22,%22steps%22:[%7B%22step%22:%22writeFile%22,%22path%22:%22/wordpress/test.php%22,%22data%22:%22%3Cpre%3E%3C?php%20var_dump(glob(%27/wordpress/wp-includes/fonts/*%27));%20var_dump(glob(%27/wordpress/wp-includes/images/media/*%27));%20var_dump(glob(%27/wordpress/wp-content/plugins/akismet/_inc/*%27));%22}]}

array(3) {
  [0]=>
  string(60) "/wordpress/wp-includes/fonts/class-wp-font-face-resolver.php"
  [1]=>
  string(51) "/wordpress/wp-includes/fonts/class-wp-font-face.php"
  [2]=>
  string(42) "/wordpress/wp-includes/fonts/dashicons.svg"
}
array(9) {
  [0]=>
  string(47) "/wordpress/wp-includes/images/media/archive.png"
  [1]=>
  string(45) "/wordpress/wp-includes/images/media/audio.png"
  [2]=>
  string(44) "/wordpress/wp-includes/images/media/code.png"
  [3]=>
  string(47) "/wordpress/wp-includes/images/media/default.png"
  [4]=>
  string(48) "/wordpress/wp-includes/images/media/document.png"
  [5]=>
  string(51) "/wordpress/wp-includes/images/media/interactive.png"
  [6]=>
  string(51) "/wordpress/wp-includes/images/media/spreadsheet.png"
  [7]=>
  string(44) "/wordpress/wp-includes/images/media/text.png"
  [8]=>
  string(45) "/wordpress/wp-includes/images/media/video.png"
}
array(3) {
  [0]=>
  string(59) "/wordpress/wp-content/plugins/akismet/_inc/akismet-admin.js"
  [1]=>
  string(62) "/wordpress/wp-content/plugins/akismet/_inc/akismet-frontend.js"
  [2]=>
  string(53) "/wordpress/wp-content/plugins/akismet/_inc/akismet.js"
}

@adamziel adamziel requested a review from seanmorris November 27, 2023 15:07
@adamziel adamziel self-assigned this Nov 27, 2023
playground.wordpress.net ships an optimized WordPress build where most
static assets are removed to keep the initial download snappy. However,
some backend code actually depends on those assets being present as seen
in #729 and #770. This PR allowlists additional files:

* wp-includes/images/media
* wp-includes/fonts/dashicons.svg
* wp-content/plugins/akismet/_inc

To test, run Playground locally, go to this URL, and confirm it displays
the list of files as shown below.

http://localhost:5400/website-server/#%7B%22landingPage%22:%22/test.php%22,%22steps%22:[%7B%22step%22:%22writeFile%22,%22path%22:%22/wordpress/test.php%22,%22data%22:%22%3Cpre%3E%3C?php%20var_dump(glob(%27/wordpress/wp-includes/fonts/*%27));%20var_dump(glob(%27/wordpress/wp-includes/images/media/*%27));%20var_dump(glob(%27/wordpress/wp-content/plugins/akismet/_inc/*%27));%22}]}

```
array(3) {
  [0]=>
  string(60) "/wordpress/wp-includes/fonts/class-wp-font-face-resolver.php"
  [1]=>
  string(51) "/wordpress/wp-includes/fonts/class-wp-font-face.php"
  [2]=>
  string(42) "/wordpress/wp-includes/fonts/dashicons.svg"
}
array(9) {
  [0]=>
  string(47) "/wordpress/wp-includes/images/media/archive.png"
  [1]=>
  string(45) "/wordpress/wp-includes/images/media/audio.png"
  [2]=>
  string(44) "/wordpress/wp-includes/images/media/code.png"
  [3]=>
  string(47) "/wordpress/wp-includes/images/media/default.png"
  [4]=>
  string(48) "/wordpress/wp-includes/images/media/document.png"
  [5]=>
  string(51) "/wordpress/wp-includes/images/media/interactive.png"
  [6]=>
  string(51) "/wordpress/wp-includes/images/media/spreadsheet.png"
  [7]=>
  string(44) "/wordpress/wp-includes/images/media/text.png"
  [8]=>
  string(45) "/wordpress/wp-includes/images/media/video.png"
}
array(3) {
  [0]=>
  string(59) "/wordpress/wp-content/plugins/akismet/_inc/akismet-admin.js"
  [1]=>
  string(62) "/wordpress/wp-content/plugins/akismet/_inc/akismet-frontend.js"
  [2]=>
  string(53) "/wordpress/wp-content/plugins/akismet/_inc/akismet.js"
}
```
@adamziel
Copy link
Collaborator Author

@seanmorris I'm merging this one, please still review in retrospect and LMK if you have any notes

@adamziel adamziel merged commit f6bc531 into trunk Nov 29, 2023
@adamziel adamziel deleted the restore-wp-media branch November 29, 2023 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wp-includes/images/ missing Include /wp-includes/fonts/dashicons.svg in the bundle
1 participant